Question: $f(x) = |x+2|$ Evaluate the definite integral. $\int^0_{-4}f(x)\,dx = $ Choose 1 answer: Choose 1 answer: (Choice A) A $0$ (Choice B) B $2$ (Choice C) C $4$ (Choice D) D $16$
Solution: Splitting up the absolute value Notice that the absolute value function is a piecewise function. Here we have that: $f(x) = \begin{cases} x +2 & \text{for} ~~~~x\geq-2 \\ -2-x & \text{for} ~~~~ x \lt-2\end{cases}$ Splitting up the definite integral Since we're working with a piecewise function, we need to split the definite integral up into two pieces: $\phantom{=} \int^0_{-4}f(x)\,dx$ $= \int^0_{-2}f(x)\,dx + \int^{-2}_{-4}f(x)\,dx~~~~~~$ [Why did we split at -2?] $= \int^0_{-2}(x +2)\,dx + \int^{-2}_{-4}(-2-x)\,dx ~~~~~~$ Evaluating each piece Next, let's evaluate each of these definite integrals one at a time. The first definite integral: $\begin{aligned} \int^0_{-2}(x +2)\,dx~ &=\dfrac12x^2 + 2x\Bigg|^0_{{-2}} \\\\ &= \left[\dfrac12 ( 0)^2 + 2\cdot(0) \right] - \left[\dfrac12 ( {-2})^2 + 2\cdot({-2}) \right] \\\\ &= \left[0\right] -\left[-2 \right] \\\\ &= {2}\end{aligned}$ The second definite integral: $\begin{aligned} \int^{-2}_{-4}(-2-x)\,dx~ &=-2x - \dfrac12x^2\Bigg|^{-2}_{{-4}} \\\\ &= \left[- 2\cdot({-2}) - \dfrac12\cdot ( {-2})^2 \right] - \left[-2\cdot({-4}) - \dfrac12\cdot ( {-4})^2 \right] \\\\ &= \left[2\right] -\left[0 \right] \\\\ &= {2}\end{aligned}$ Putting the pieces together Now let's add these two pieces together to find the answer: $\phantom{=} \int^0_{-2}(x +2)\,dx + \int^{-2}_{-4}(-2-x)\,dx$ $ = {2} + {2}$ $ = 4$ The answer $\int^0_{-4}f(x)\,dx = 4$